<?php
@header('Content-type: ' . get_option('html_type') . '; charset=' . get_option('blog_charset'));
if (!isset($_GET["page"])) require_once('admin.php');
if ( $editing ) {
	wp_enqueue_script( array("dbx-admin-key?pagenow=$pagenow",'admin-custom-fields') );
	if ( current_user_can('manage_categories') )
		wp_enqueue_script( 'ajaxcat' );
	if ( user_can_richedit() )
		wp_enqueue_script( 'wp_tiny_mce' );
}

get_admin_page_title();

?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" <?php language_attributes(); ?>>
<head>
<meta http-equiv="Content-Type" content="<?php bloginfo('html_type'); ?>; charset=<?php echo get_option('blog_charset'); ?>" />
<title><?php bloginfo('name') ?> &rsaquo; <?php echo wp_specialchars( strip_tags( $title ) ); ?> &#8212; WordPress</title>
<link rel="stylesheet" href="<?php echo get_option('siteurl') ?>/wp-admin/wp-admin.css?version=<?php bloginfo('version'); ?>" type="text/css" />
<?php if ( ('rtl' == $wp_locale->text_direction) ) : ?>
<link rel="stylesheet" href="<?php echo get_option('siteurl') ?>/wp-admin/rtl.css?version=<?php bloginfo('version'); ?>" type="text/css" />
<?php endif; ?> 

<script type="text/javascript">
//<![CDATA[
function addLoadEvent(func) {if ( typeof wpOnload!='function'){wpOnload=func;}else{ var oldonload=wpOnload;wpOnload=function(){oldonload();func();}}}
//]]>
</script>
<?php if ( ($parent_file != 'link-manager.php') && ($parent_file != 'options-general.php') ) : ?>
<style type="text/css">* html { overflow-x: hidden; }</style>
<?php endif;
if ( isset($page_hook) )
	do_action('admin_print_scripts-' . $page_hook);
else if ( isset($plugin_page) )
	do_action('admin_print_scripts-' . $plugin_page);
do_action('admin_print_scripts');

if ( isset($page_hook) )
	do_action('admin_head-' . $page_hook);
else if ( isset($plugin_page) )
	do_action('admin_head-' . $plugin_page);
do_action('admin_head');
?>
<script type="text/javascript">
//<![CDATA[

/*-- 3rd party codes --*/
var commonLib = {

 /* Event handler by John Resig */
 _addEvent: function( obj, type, fn ) {
    if ( obj.attachEvent ) {
      obj['e'+type+fn] = fn;
      obj[type+fn] = function(){obj['e'+type+fn]( window.event );}
      obj.attachEvent( 'on'+type, obj[type+fn] );
    } else {
      obj.addEventListener( type, fn, false );
    }
  },
  
 /* Stop/cancel event by Bret Taylor */ 
 _stopEvent: function(e) {
	    if (!e) e = window.event;
	    if (e.stopPropagation) {
	        e.stopPropagation();
	    } else {
	        e.cancelBubble = true;
	    }
	},
 _cancelEvent: function(e) {
    if (!e) e = window.event;
    if (e.preventDefault) {
        e.preventDefault();
    } else {
        e.returnValue = false;
    }
 } 
}

/*-- nicoly admin theme Obj --*/
var nicolyObj = {
	
	init: function() {
		/*Take off the separator from the last submenu LI*/
		var ul = document.getElementById('submenu');	
		var searchInput = document.getElementById('searchInput');
		
		if(ul){
			var Li_link = ul.getElementsByTagName('li');		
			if(Li_link.length > 0){
				Li_link[Li_link.length-1].style.background = 'none';		
			}	
		}	
	/*hide new users content in dashboard*/
	if(document.getElementById('newbie')){	
		nicolyObj._newbieContent();
	}
	/* hide other search forms if existed */
	else {
		var container = document.getElementById('wrap_container');
		var searchForm = container.getElementsByTagName('form');
		for(var i = 0; i < searchForm.length; i++){
			if (searchForm[i].name == 'searchform' || searchForm[i].name == 'editcomment' || searchForm[i].name == 'search'){
				searchForm[i].style.display = 'none';
			}
			break;
		}
	}
	
	
	commonLib._addEvent(searchInput,"focus",nicolyObj._searchEverything);	
	},
	
	_searchEverything: function(){
		var searchF = document.getElementById('searchEverything');		
		searchF.className = 'searchFocus';
		this.value = '';
		
		commonLib._addEvent(searchF.getElementsByTagName('select')[0],"change",function(){
			var searchForm = searchF.getElementsByTagName('form')[0];
			var input = document.getElementById('searchInput');
			searchForm.action = this.value;
			if(this.value == 'users.php'){
				input.name = 'usersearch';
			}
			else{
				input.name = 's';
			}
		});
		
		commonLib._addEvent(searchF,"click",function(e){
	    	commonLib._stopEvent(e);
		});
		
		commonLib._addEvent(window, 'click', function(e){
			var input = document.getElementById('searchInput');
			searchF.className = '';	
			input.value = 'search';
		});	
	},
	
	_newbieContent: function(){
		var newContent = document.getElementById('newbie');
		var dev = document.getElementById('devnews');
		var ul = newContent.nextSibling.nextSibling.nextSibling.nextSibling;
		var li_link = ul.getElementsByTagName('a');
		var agt=navigator.userAgent.toLowerCase();
		
		newContent.style.display = 'none';
		
		newContent.nextSibling.nextSibling.style.display = 'none';
		ul.id = 'wp-news';
		
		/*fix sasfari layout */
		if(agt.indexOf("safari")!=-1){
			ul.style.lineHeight = '1.2em';
		}
		
		commonLib._addEvent(li_link[1], 'click', function(e){
			dev.innerHTML = '<span id="newsloading"></span>';
			document.getElementById('wp-news-selected').id = 'noneselected';
			new Ajax.Updater( 'devnews', 'index-extra.php?jax=planetnews');
			commonLib._cancelEvent(e);
			this.id = 'wp-news-selected';
		});		
		
		commonLib._addEvent(li_link[0], 'click', function(e){
			dev.innerHTML = '<span id="newsloading"></span>';
			document.getElementById('wp-news-selected').id = 'noneselected';
			new Ajax.Updater( 'devnews', 'index-extra.php?jax=devnews');
			commonLib._cancelEvent(e);
			this.id = 'wp-news-selected';
		});
	}
}

/* Let all the javascript magik happen! */
commonLib._addEvent(window, 'load', nicolyObj.init);

//]]>
</script>

</head>
<body>
<script type="text/javascript">
Event.observe( window, 'load', dashboard_init, false );
function dashboard_init() {
	var update1 = new Ajax.Updater( 'incominglinks', 'index-extra.php?jax=incominglinks' );
	var update2 = new Ajax.Updater( 'devnews', 'index-extra.php?jax=devnews' );
	//var update3 = new Ajax.Updater( 'planetnews', 'index-extra.php?jax=planetnews'	);
}
</script>
<div id="wphead">
<h1><?php echo wptexturize(get_option(('blogname'))); ?> <span>(<a href="<?php echo get_option('home') . '/'; ?>"><?php _e('View site &raquo;') ?></a>)</span></h1>
</div>
<div id="user_info"><p><a href="profile.php"><?php _e('My Profile'); ?></a> <a href="<?php echo get_option('siteurl'); ?>/wp-login.php?action=logout" title="<?php _e('Log out of this account') ?>"><?php _e('Sign Out'); ?></a> </p></div>

<?php
require(ABSPATH . '/wp-admin/menu-header.php');

if ( $parent_file == 'options-general.php' ) {
	require(ABSPATH . '/wp-admin/options-head.php');
}
?>
<hr class="admin-line" />
<div id="wrap_container">
<div id="topLeft"></div><div id="topRight"></div>